﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

#nullable disable

namespace Models
{
    public partial class DeviceRecord
    {
        public uint Id { get; set; }
        public string Description { get; set; }

        [Required(ErrorMessage ="请选择设备类型")]
        [Display(Name = "设备类型")]
        public uint CategoryId { get; set; }

        [Required(ErrorMessage ="请选择厂商")]
        [Display(Name = "厂商")]
        public uint VendorId { get; set; }

        public string Mac { get; set; }
        public string Ip { get; set; }
        public string Photo { get; set; }

        [DataType(DataType.Currency)]
        [Column(TypeName = "decimal(18, 2)")]
        public decimal Price { get; set; }

        public string State { get; set; }
        public DateTime? PurchasedDate { get; set; }
        public DateTime? ExpireDate { get; set; }
        public uint? PurchaseChannelId { get; set; }
        public uint? DepreciationRuleId { get; set; }

        [Required(ErrorMessage ="请输入资产编码")]
        [Display(Name ="资产编码")]
        public string AssetNumber { get; set; }

        public DateTime? DeleteAt { get; set; }
        public DateTime CreateAt { get; set; }
        public DateTime UpdatedAt { get; set; }

        // 扩展属性
        [NotMapped]
        public string CategoryName { get; set; }

        [NotMapped]
        public string PurchaseChannelName { get; set; }

        [NotMapped]
        public string DepreciationRule { get; set; }

        [NotMapped]
        public string VendorName { get; set; }
    }
}
